﻿<div class="row">
    <div class="col-xs-12 col-md-12 col-lg-12">
        <div class="widget">
            <div class="widget-header bg-blue">
            	<i class="widget-icon fa fa-arrow-left"></i>
                <span class="widget-caption">模块设置</span>
                <div class="widget-buttons">
                    <a href="#" data-toggle="maximize">
                        <i class="fa fa-expand"></i>
                    </a>
                    <a href="#" data-toggle="collapse">
                        <i class="fa fa-minus"></i>
                    </a>
                    <a href="#" data-toggle="dispose">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="widget-body" style="height: auto;">
				
				<div class="form-title">
                    <a href="/Admin/User/moder" class="btn btn-primary" data-loader="bb-loader" data-loadername="模块管理">
						<i class="fa fa-mail-reply"></i>返回
					</a>
                </div>
                
                <form id="bbForm" action="" method="post" class="form-horizontal"
                                                  data-bv-message=""
                                                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                                                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                                                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
                <input type="hidden" name="id" value="{$cache.id}">
                
                
                <div class="form-group">
				    <label class="col-lg-2 control-label">上级菜单<sup>*</sup></label>
				    <div class="col-lg-4">
				    	<select name="pid">
				    		<option value="0">一级菜单</option>
				    		<volist name="moders" id="vo">
                        		<option value="{$vo.id}" <eq name="vo.id" value="$cache['pid']" > selected="selected" </eq> > {$vo._name} </option>
                        	</volist>
				    	</select>
				    </div>
				</div>
                 
                 
				<div class="form-group">
				    <label class="col-lg-2 control-label">菜单名称<sup>*</sup></label>
				    <div class="col-lg-4">
				    <input type="text" class="form-control" name="title" placeholder="必填"
				                                           data-bv-notempty="true"
				                                           data-bv-notempty-message="不能为空" value="{$cache.title}">
				    </div>
				</div>
				
				<div class="form-group">
				    <label class="col-lg-2 control-label">url<sup>*</sup></label>
				    <div class="col-lg-4">
				    <input type="text" class="form-control" name="name" placeholder="必填"
				                                           data-bv-notempty="true"
				                                           data-bv-notempty-message="不能为空" value="{$cache.name}">
				    </div>
				</div>
				
				<div class="form-group">
				    <label class="col-lg-2 control-label">参数<sup></sup></label>
				    <div class="col-lg-4">
				    <input type="text" class="form-control" name="param" value="{$cache.param}">
				    </div>
				</div>
				
				<div class="form-group">
				    <label class="col-lg-2 control-label">图标</label>
				    <div class="col-lg-4">
				    <input type="text" class="form-control" name="ico" value="{$cache.ico}">
				    </div>
				</div>
				
				<div class="form-group">
				    <label class="col-lg-2 control-label">排序<sup></sup></label>
				    <div class="col-lg-4">
				    <input type="text" class="form-control" name="list_order" value="{$cache.list_order}">
				    </div>
				</div>
				
				<div class="form-group">
				    <label class="col-lg-2 control-label">备注<sup></sup></label>
				    <div class="col-lg-4">
				    	<textarea class="form-control" name="comment">{$cache.comment}</textarea>
				    </div>
				</div>
				
				<div class="form-group">
                    <label class="col-lg-2 control-label">显示</label>
                    <div class="col-xs-4">
                        <label>
                        	<input type="hidden" name="status" value="{$cache.status|default=1}" id="issku">
                            <input class="checkbox-slider colored-blue" type="checkbox" id="isskubtn" <eq name="cache.status|default=1" value="1">checked="checked"</eq> >
                            <span class="text"></span>
                        </label>
                    </div>
                </div>
                
                <div class="form-group">
                    <label class="col-lg-2 control-label">包含的操作</label>
                    <div class="col-xs-6" style="margin-left: -19px;">
                    	<div class="checkbox" style="float: left;">
	                    		<label>
	                    		<volist name="iscaozhuo" id="vo">
	                            	<if condition="$vo['title']=='add' ">
			                            <input type="hidden" name="addid" value="{$vo.id}" />
			                        </if>
	                            </volist>
	                    		<input type="hidden" name="add" value="{$cache.add|default=0}" id="isadd" />
	                            <input type="checkbox" class="colored-success" id="isaddbtn"
	                            	<volist name="iscaozhuo" id="vo">
	                            		<if condition="$vo['title']=='add' ">
	                            			checked="checked"
	                            		</if>
	                            	</volist>
	                            />
	                            <span class="text">添加</span>
	                        </label>
	                    </div>
	                    
	                     <div class="checkbox" style="float: left;">
	                        <label>
	                        	<volist name="iscaozhuo" id="vo">
	                            	<if condition="$vo['title']=='edit' ">
			                            <input type="hidden" name="editid" value="{$vo.id}" />
			                        </if>
	                            </volist>
	                            <input type="hidden" name="edit" value="{$cache.edit|default=0}" id="isedit" />
	                            <input type="checkbox" class="colored-success" id="iseditbtn"
	                            	<volist name="iscaozhuo" id="vo">
	                            		<if condition="$vo['title']=='edit' ">
	                            			checked="checked"
	                            		</if>
	                            	</volist>	
	                            />
	                            <span class="text">修改</span>
	                        </label>
	                    </div>
	                    
	                    <div class="checkbox" style="float: left;">
	                        <label>
	                        	<volist name="iscaozhuo" id="vo">
	                            	<if condition="$vo['title']=='del' ">
			                            <input type="hidden" name="delid" value="{$vo.id}" />
			                        </if>
	                            </volist>
	                        	<input type="hidden" name="del" value="{$cache.del|default=0}" id="isdel" />
	                            <input type="checkbox" class="colored-success" id="isdelbtn"
	                            	<volist name="iscaozhuo" id="vo">
	                            		<if condition="$vo['title']=='del' ">
	                            			checked="checked"
	                            		</if>
	                            	</volist>
	                            />
	                            <span class="text">删除</span>
	                        </label>
	                    </div>
	                    
	                </div>
	                
                </div>

                
               <div class="form-group">
                         <div class="col-lg-offset-2 col-lg-4">
                         <button class="btn btn-primary btn-lg" type="submit">保存</button>&nbsp;&nbsp;&nbsp;&nbsp;
                         <button class="btn btn-palegreen btn-lg" type="reset">重填</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
          
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>

<!--表单验证与提交封装-->
<script type="text/javascript">
	$('#bbForm').bootstrapValidator({
		submitHandler: function (validator, form, submitButton) {
           var tourl="{:U('Admin/User/moder_set')}";
           var data=$('#bbForm').serialize();
           $.bb.ajax('post',tourl,data,null);
           return false;
        },
	});
	
	$('#isskubtn').on('click',function(){
		var value=$(this).prop('checked')?1:0;
		$('#issku').val(value);
	});
	
	//=============================
	$('#isaddbtn').on('click',function(){
		var value=$(this).prop('checked')?1:0;
		$('#isadd').val(value);
	});
	$('#iseditbtn').on('click',function(){
		var value=$(this).prop('checked')?1:0;
		$('#isedit').val(value);
	});
	$('#isdelbtn').on('click',function(){
		var value=$(this).prop('checked')?1:0;
		$('#isdel').val(value);
	});
	//==================================
</script>



<!--/表单验证与提交封装-->